var events = require("events");
var util = require("util");
var Emitter = events.EventEmitter;

function Radio(radioName, hertz){
    this.radioName = radioName;
    this.hertz = hertz;
    Emitter.call(this);
}

util.inherits(Radio, Emitter);
Radio.prototype.play = function(){
    console.log("“" + this.radioName + "” " + this.hertz + " opened");
    setTimeout(() => {
        console.log("lalala...");
    },2000);
}
Radio.prototype.stop = function(){
    setTimeout(() => {
        console.log("“" + this.radioName + "” " + this.hertz + " closed");
    },3000);
}

module.exports = Radio;